import { useContext } from 'react';
import { ContentType } from '../../constants';
import { MySdkStoreContext } from '../../context';

import './style.scss';

export default function(props) {
  const { mockConfig } = useContext(MySdkStoreContext);
  const { from: { userId }, content, onReEdit } = props;

return (<div className="recallComponent">
    {userId === mockConfig.userId ? '你' : userId}撤回了一条消息 { content?.msgType === ContentType.Text && <a className="editBtn" onClick={() => onReEdit(content.text)}>重新编辑</a> }
  </div>)
}
